﻿using Calico.Client.Filters;
using Calico.Client.Handlers;
using System.Web.Mvc;

namespace Calico.Client
{
    public class FilterConfig
    {
		/// <summary>
		/// Registers filters globally
		/// </summary>
		/// <param name="filters"></param>
        public static void RegisterGlobalFilters(GlobalFilterCollection filters)
        {
			// Always Require Https at the application level.
			// This prevents accidental data exposure in the event the server is improperly configured.
			// filters.Add(new RequireHttpsAttribute()); <<< TURN ON IN PRODUCTION

			// Globally set entire site to no cache
			filters.Add(new NoCache());

			// Globally enable Authenticated User Attribute
			filters.Add(new AuthenticatedUserAttribute());

			// Globally log exceptions
			filters.Add(new GlobalExceptionHandler());

			// Error Handling
			// filters.Add(new HandleErrorAttribute()); <<< THIS WILL BE HANDLED LATER
        }
    }
}
